package com.riskblockchain.util;

import lombok.Data;

@Data
public enum ResultCodeEnum {
    NETWORK_REQUEST_EXCEPTION(9999, "网络请求异常"),
    SYSTEM_EXCEPTION(10001, "系统异常"),
    PARAMETER_EXCEPTION(10101, "参数异常"),
    TOKEN_INVALID(10201, "token不合法"),
    CHAIN_NOT_FOUND(10202, "链不存在"),
    PEER_NOT_FOUND(10203, "相关peer不存在"),
    TOKEN_EXPIRED(10204, "token过期"),
    CHAIN_FETCH_EXCEPTION(10301, "链获取异常"),
    CHANNEL_FETCH_EXCEPTION(10302, "通道获取异常"),
    CHAINCODE_EXECUTION_EXCEPTION(10303, "链码执行异常"),
    REFRESH_TOKEN_SYSTEM_EXCEPTION(10401, "刷新token失败，系统异常"),
    REFRESH_TOKEN_COMMUNICATION_EXCEPTION(10402, "刷新token失败，通信异常"),
    REFRESH_TOKEN_FROZEN(10403, "刷新token被冻结"),
    LEDGER_DATA_FETCH_FAILURE(10501, "账本数据获取失败"),
    BLOCK_HASH_FETCH_FAILURE(10502, "通过Hash获取区块失败"),
    BLOCK_HASH_PARSE_FAILURE(10503, "区块Hash解析失败"),
    BLOCK_BY_TRANSACTION_FETCH_FAILURE(10504, "通过交易获取区块失败"),
    BLOCK_BY_NUMBER_FETCH_FAILURE(10505, "通过编号获取区块失败"),
    BLOCK_CONTENT_FETCH_FAILURE(10506, "获取区块内容失败"),
    BLOCK_CONTENT_PARSE_FAILURE(10507, "区块内容解析失败"),
    TRANSACTION_FETCH_FAILURE(10508, "获取交易失败"),
    TRANSACTION_PARSE_FAILURE(10509, "交易解析失败");

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    private  int code;
    private  String message;

    ResultCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }



}
